<?php

//People
class Form_Street_Create extends Base_Form
{
    public function init()
    {
		$this->addElements(array(
			// Add an username element
            new Zend_Form_Element_Text('name', array(
                'required'   => true,
                'label'      => 'Street name:',
                'filters'    => array('StringTrim'),
                'validators' => array(
					array('validator' => 'StringLength', 'options' => array(4,30))
                )
            )),
			// Add an username element
            new Zend_Form_Element_Text('code', array(
                'required'   => true,
                'label'      => 'Floor encode:',
                'filters'    => array('StringTrim'),
                'validators' => array(
					array('validator' => 'Regex', 'options' => "/^\d(,\d){4}$/"),
                )
            )),
			// Add an username element
            new Zend_Form_Element_Text('area', array(
                'required'   => true,
                'label'      => 'Image area:',
                'filters'    => array('StringTrim'),
                'validators' => array(
					array('validator' => 'Regex', 'options' => "/^\d{1,3}(,\d{1,3}){3}$/"),
                )
            )),
			// Add an username element
            new Zend_Form_Element_Textarea('intro', array(
                'required'   => true,
                'label'      => 'Intro:',
                'filters'    => array('StringTrim'),
                'validators' => array(
					array('validator' => 'StringLength', 'options' => array(30,255))
                )
            )),
        ));

        $this->addDisplayGroup(
            array('name','code','area','intro'), 'street',
			array(
				'legend' => 'Street'
			)
		);
    }
}